<script>
	/**
	 * vuex管理登陆状态
	 */
	import {
		mapMutations
	} from 'vuex'
	export default {
		methods: {
			...mapMutations(['login'])
		},
		onLaunch: function() {
			// 初始化登录状态
			let userInfo = uni.getStorageSync('userInfo') || null
			if (userInfo && userInfo.id) {
				uni.getStorage({
					key: 'userInfo',
					success: res => {
						// console.log(res)
						this.login(res.data)
					}
				})
			}
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/* colorui */
	@import "colorui/main.css";
	@import "colorui/icon.css";
</style>
